﻿using System.Collections.ObjectModel;
using ObservableCollections.Events;

namespace ObservableCollections.Interfaces
{
    /// <summary>
    /// three steps to enable this interface for complete duplicate filtering functionality:
    ///    1. Use the snippet to add the implementation to the entity extender
    ///    2. In the collection change in the ViewModel rebind method check for duplicate in the property change
    ///    3. when an entity is deleted call check duplicated when deleted.
    /// </summary>
    public interface IDuplicateAwareEntity
    {
        bool IsDuplicate { get; set; }
        void CheckDuplicate(IDuplicateAwareEntity entity);
        ObservableCollection<IDuplicateAwareEntity> Duplicates { get; set; }
        void CheckDuplicateOnDelete();
        event DuplicateEventHandler DuplicateChanged;
        void Reset();
    }
}
